#include <iostream>
using namespace std;

int main()
{
	int a, b, c;
	int result = 0;
	cin >> a >> b >> c;
	if(a < 60)
		result++;
	if(b < 60)
		result++;
	if(c < 60)
		result++;
	if(result == 1)
		cout << 1 << endl;
	else
		cout << 0 << endl;
    return 0;
}

